Rsd.define('Rsd.Faith.views.ListMenu', {
    extend: 'Rsd.control.ListView',
    xtype: 'home-menu',
    requires: ['Rsd.Faith.stores.MenuStore','Rsd.control.ToolBar','Rsd.control.Link','Rsd.control.ComboBox'],
    margin: '0 0 0 0',
    width: 120,
    menu:null,
    /*
    * */
    constructor: function ListMenu(config) {

        this.apply(config);

        this.label.content = this.logo;
        this.label.visible = false;
    },
    /*
    *
    * */
    loadData:function loadData(data)
    {
        var me = this;

        var _data = data||me.menu;
        if(_data)
        {
            me.menu = _data;
            var _nodeList=[];
            var _list = _data.children||[];
            for(var i in _list)
            {
                var m = _list[i];
                _nodeList.push({
                    xtype:'svg',
                    label:{width:85,height:25,content:m.text,position:'right',align:'right'},
                    width:m.width||116,
                    margin:'10 20 10 10',
                    height:45,
                    menu:m,
                    tagName:m.icon,
                    children:m.children
                });
            }

            me.callParent(_nodeList);
        }

    }

},function(type) {

    var _logoGetter = function () {
        if(this.label.content)
        {
            return this.label.content;
        }
        return this.__logo;
    };

    var _logoSetter = function (value) {
        if(this.label && this.label.element)
        {
            this.label.element.src = value;
        }
        this.__logo = value;
    };


    this.defineProperty(type, "logo", _logoGetter, _logoSetter, true);
});
